﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace student_table.Entity
{
    class shujuqianyi:DbContext
    {
        // 将表映射到数据库里面

        //昨天少加了下边的public ，所以从外界不出来
       public  DbSet<ClassGrade> classGrades { get; set; }
       public  DbSet<Student> students { get; set; }
        protected override void OnConfiguring(DbContextOptionsBuilder options)
        {
            options.UseMySQL("Server=localhost;Port=3306;Database=TestMySql; User=root;Password=root;");
        }


    }
}
